import Cookies from 'js-cookie'

//k-v的路由k
const TokenKey = 'MP_token'

const TenantIdKey = 'MPTENANT_ID'

//从cookie中获取token
export function getToken () {
  return Cookies.get(TokenKey)
}
//设置token
export function setToken (token) {
  return Cookies.set(TokenKey, token)
}

//移除token
export function removeToken () {
  return Cookies.remove(TokenKey)
}
export function getTenantId () {
  return localStorage.getItem(TenantIdKey)
}

export function setTenantId (username) {
  localStorage.setItem(TenantIdKey, username)
}

export function removeTenantId () {
  localStorage.removeItem(TenantIdKey)
}
